package core;

public class GameFlow {
	GameManagerAbs gameManager;

	public GameFlow(GameManagerAbs gameManager) {
		this.gameManager = gameManager;
		gameManager.initialize();
		gameLoop();
	}

	private void gameLoop() {
		while (true) {
			gameManager.match();

			do {
				gameManager.round();
				do { // last player is done
					gameManager.turn();
				} while (!gameManager.isRoundDone());

				gameManager.endRound();
			} while (!gameManager.isMatchDone()); // check victory players

			gameManager.endMatch();
		}
	}
}
